package com.haiyan.demo06_多个变量指向相同的对象地址;

public class Test {
    public static void main(String[] args) {
        Student stu1=new Student();
        stu1.name="张三";
        stu1.age=18;
        System.out.println(stu1.name+","+stu1.age);
        stu1.study();
        System.out.println("==========================");
        Student stu2=stu1;
        System.out.println(stu2.name+","+stu2.age);
        stu2.name="李四";
        stu2.age=20;
        System.out.println(stu1.name+","+stu1.age);
    }
}
